<?php

namespace App\Http\Controllers\Admin;

use App\Models\Department;

class DepartmentController extends BaseController
{

    public function __construct(Department $department)
    {
        parent::__construct();
        $this->department = $department;
    }

    public function getDepartmentData(){
        $res = $this->department->getOneData(request());
        return ajax_return($res);
    }

    public function getList(){
        $res = $this->department->getCacheCategoryList();
        return ajax_return($res);
    }

    /**
     * 添加科室
     */
    public function postAddDepartment()
    {
         $data = $this->department->AddDepartment(request());
         return ajax_return($data);
    }

}
